package uestc.lj.midPromotion.beatingtable;

/**
 * @Author:Crazlee
 * @Date:2021/11/30
 */
public class Code02_ProblemEat {
	public static String winner1(int n) {
		if (n < 5) {
			return (n == 0 || n == 2) ? "后手" : "先手";
		}
		int base = 1;
		while (base <= n) {
			if ("后手".equals(winner1(n - base))) {
				return "先手";
			}
			if (base > n / 4) {
				break;
			}
			base *= 4;
		}
		return "后手";
	}

	public static void winner2(int n) {
		if (n % 5 == 0 || n % 5 == 2) {
			System.out.println("后手");
		} else {
			System.out.println("先手");
		}
	}
}
